﻿using CCSFeederCameraUI2.Data.MClass;
using Microsoft.EntityFrameworkCore;

namespace CCSFeederCameraUI2.Data
{
    public class MDbContext : DbContext
    {
        private string? DbPath;
        public DbSet<PartNum> PartNums { get; set; }
        public DbSet<MParam> MParams { get; set; }
        public DbSet<MBarcode> MBarcodes { get; set; }
        public DbSet<SelectRule> SelectRules { get; set; }
        public DbSet<MLotNo> MLotNos { get; set; }
        protected override void OnConfiguring(DbContextOptionsBuilder options)
        {
            options.UseSqlite($"Data Source={DbPath};Pooling=False");
        }
        public MDbContext()
        {
            var path = System.AppDomain.CurrentDomain.BaseDirectory;
            DbPath = System.IO.Path.Join(path, "point.db");
        }
    }
}